/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import BLL.BLLManu;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 *
 * @author Pham
 */
public class DTOProduct {
    int productID;
    String productName;
    int productQuantity;
    String productImage;
    Date productDateUpdate;
    String productDescription;
    String productWarranty;
    String productPromotion;
    long productPrice;
    DTOManufacture manu;
    
    //accessors
    public int getProductID() {
        return productID;
    }

    public void setProductID(int productID) {
        this.productID = productID;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public int getProductQuantity() {
        return productQuantity;
    }

    public void setProductQuantity(int productQuantity) {
        this.productQuantity = productQuantity;
    }

    public String getProductImage() {
        return productImage;
    }

    public void setProductImage(String productImage) {
        this.productImage = productImage;
    }

    public Date getProductDateUpdate() {
        return productDateUpdate;
    }

    public void setProductDateUpdate(Date productDateUpdate) {
        this.productDateUpdate = productDateUpdate;
    }

    public String getProductDescription() {
        return productDescription;
    }

    public void setProductDescription(String productDescription) {
        this.productDescription = productDescription;
    }

    public String getProductWarranty() {
        return productWarranty;
    }

    public void setProductWarranty(String productWarranty) {
        this.productWarranty = productWarranty;
    }

    public String getProductPromotion() {
        return productPromotion;
    }

    public void setProductPromotion(String productPromotion) {
        this.productPromotion = productPromotion;
    }

    public long getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(long productPrice) {
        this.productPrice = productPrice;
    }

    public DTOManufacture getManu() {
        return manu;
    }

    public void setManu(DTOManufacture manu) {
        this.manu = manu;
    }
    
    
    //contructors
    public DTOProduct()
    {
        
    }
    public DTOProduct(ResultSet rs) throws SQLException
    {
        this.productID = (rs.getInt("product_id"));
        this.productName = (rs.getString("product_name"));
        this.productQuantity = (rs.getInt("product_quantity"));
        this.productPrice = (rs.getLong("product_price"));
        this.productImage = (rs.getString("product_image"));
        this.productDateUpdate = (rs.getDate("product_dateupdate"));
        this.productDescription = (rs.getString("product_description"));
        this.productPromotion = (rs.getString("product_promotion"));
        this.productWarranty = (rs.getString("product_warranty"));
        this.manu = (new BLLManu()).getManuByID(rs.getInt("manufacture_id"));
    }

    public DTOProduct(String productName, int productQuantity, String productImage, Date productDateUpdate, String productDescription, String productWarranty, String productPromotion, long productPrice, DTOManufacture manu) {
        this.productName = productName;
        this.productQuantity = productQuantity;
        this.productImage = productImage;
        this.productDateUpdate = productDateUpdate;
        this.productDescription = productDescription;
        this.productWarranty = productWarranty;
        this.productPromotion = productPromotion;
        this.productPrice = productPrice;
        this.manu = manu;
    }
    
    
}
